<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>Visual Studio 2019 使用 Git | JiangKunYun&#39;s Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
    <meta name="keywords" content="熊猫不是猫,熊猫不是猫's Blog" />
  
  <meta name="description" content="最近项目源代码管理工具从 SVN 移到 Git，操作上的不同，容易导致项目代码管理混乱。这里整理一份在 VS2019 里使用 git 的操作。">
<meta property="og:type" content="article">
<meta property="og:title" content="Visual Studio 2019 使用 Git">
<meta property="og:url" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/index.html">
<meta property="og:site_name" content="JiangKunYun&#39;s Blog">
<meta property="og:description" content="最近项目源代码管理工具从 SVN 移到 Git，操作上的不同，容易导致项目代码管理混乱。这里整理一份在 VS2019 里使用 git 的操作。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%BA%90%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%E8%AE%BE%E7%BD%AE.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/vs2019git%E4%BD%8D%E7%BD%AE2.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/vs2019git%E4%BD%8D%E7%BD%AE.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Git%E6%9B%B4%E6%94%B9%E7%95%8C%E9%9D%A22.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Git%E6%9B%B4%E6%94%B9%E7%95%8C%E9%9D%A2.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Git%E5%AD%98%E5%82%A8%E5%BA%93.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%85%8B%E9%9A%86.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%85%A8%E9%83%A8%E6%8F%90%E4%BA%A4.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%9A%82%E5%AD%98%E6%8F%90%E4%BA%A4.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8F%90%E5%8F%96.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8B%89%E5%8F%96.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%86%B2%E7%AA%81.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%86%B2%E7%AA%812.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8E%A8%E9%80%81.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Squash%E6%8F%90%E4%BA%A4.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Squash%E6%8F%90%E4%BA%A42.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Squash%E6%8F%90%E4%BA%A43.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF1.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF2.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%90%88%E5%B9%B6.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%90%88%E5%B9%B62.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8C%91%E6%8B%A3.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8C%91%E6%8B%A32.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8C%91%E6%8B%A33.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%96%B0%E5%BB%BA%E5%88%86%E6%94%AF.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%96%B0%E5%BB%BA%E5%88%86%E6%94%AF2.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF%E4%BB%A3%E7%A0%81.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%A0%E9%99%A4%E5%88%86%E6%94%AF.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8E%A8%E9%80%81%E5%88%86%E6%94%AF%E4%BF%AE%E6%94%B9.png">
<meta property="og:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%86%E6%94%AF%E6%8E%A8%E9%80%812.png">
<meta property="article:published_time" content="2021-07-16T03:38:01.000Z">
<meta property="article:modified_time" content="2021-07-16T03:38:01.000Z">
<meta property="article:author" content="jiangkunyun">
<meta property="article:tag" content="git">
<meta property="article:tag" content="VS2019">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%BA%90%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%E8%AE%BE%E7%BD%AE.png">
  
  
    <link rel="icon" href="/favicon.ico">
  
  <link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>

  

  
  

<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
      <header id="header">
    <div id="banner"></div>
    <div id="header-outer">
        <div id="header-menu" class="header-menu-pos animated">
            <div class="header-menu-container">
                <a href="/" class="left">
                    <span class="site-title">熊猫不是猫的博客</span>
                </a>
                <nav id="header-menu-nav" class="right">
                    
                    <a  href="/">
                        <i class="fa fa-home"></i>
                        <span>首页</span>
                    </a>
                    
                    <a  href="/archives">
                        <i class="fa fa-archive"></i>
                        <span>归档</span>
                    </a>
                    
                    <a  href="/about">
                        <i class="fa fa-user"></i>
                        <span>关于</span>
                    </a>
                    
                </nav>
                <a class="mobile-header-menu-button">
                    <i class="fa fa-bars"></i>
                </a>
            </div>
        </div>
        <div id="header-row">
            <div id="logo">
                <a href="/">
                    <img src="/images/mylogo.png" alt="logo">
                </a>
            </div>
            <div class="header-info">
                <div id="header-title">
                    
                    <h2>
                        熊猫不是猫的博客
                    </h2>
                    
                </div>
                <div id="header-description">
                    
                    <h3>
                        一个专注 WEB 开发的技术博客
                    </h3>
                    
                </div>
            </div>
            <nav class="header-nav">
                <div class="social">
                    
                        <a title="JiangkunYun" target="_blank" href="//jiangkunyun.gitee.io/">
                            <i class="fa fa-home fa-2x"></i></a>
                    
                        <a title="Github" target="_blank" href="//github.com/jiangkunyun">
                            <i class="fa fa-github fa-2x"></i></a>
                    
                        <a title="Gitee" target="_blank" href="//gitee.com/jiangkunyun">
                            <i class="fa fa-git fa-2x"></i></a>
                    
                </div>
            </nav>
        </div>
    </div>
</header>
      <div class="outer">
        <section id="main" class="body-wrap"><article id="post-Visual-Studio-2019-使用-Git" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-inner">
    
      <header class="article-header">
        
  
    <h1 class="post-title" itemprop="name">
      Visual Studio 2019 使用 Git
    </h1>
    <div class="post-title-bar">
      <ul>
          
              <li>
                  <i class="fa fa-book"></i>
                  
                      <a href="/categories/git/">git</a>
                  
                      <a href="/categories/VS2019/">VS2019</a>
                  
              </li>
          
        <li>
          <i class="fa fa-calendar"></i>  2021-07-16
        </li>
        <li>
          <i class="fa fa-eye"></i>
          <span id="busuanzi_value_page_pv"></span>
        </li>
      </ul>
    </div>
  

          
      </header>
    
    <div class="article-entry post-content" itemprop="articleBody">
      
            
            <p>最近项目源代码管理工具从 SVN 移到 Git，操作上的不同，容易导致项目代码管理混乱。这里整理一份在 VS2019 里使用 git 的操作。</p>
<span id="more"></span>

<h3 id="VS2019-Git-设置"><a href="#VS2019-Git-设置" class="headerlink" title="VS2019 Git 设置"></a>VS2019 Git 设置</h3><h4 id="源代码管理工具"><a href="#源代码管理工具" class="headerlink" title="源代码管理工具"></a>源代码管理工具</h4><p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%BA%90%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%E8%AE%BE%E7%BD%AE.png" alt="源代码管理工具设置"></p>
<h4 id="Git-操作视图"><a href="#Git-操作视图" class="headerlink" title="Git 操作视图"></a>Git 操作视图</h4><p>VS2019 的 git 管理工具已经从团队资源管理器（2017）单独划分出来了，分为 Git 更改和 Git 存储库。</p>
<p>找不到界面的在 菜单-&gt;视图 那边把相应的视图显示出来。</p>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/vs2019git%E4%BD%8D%E7%BD%AE2.png" alt="VS2019的Git位置2"></p>
<h5 id="团队资源管理器"><a href="#团队资源管理器" class="headerlink" title="团队资源管理器"></a>团队资源管理器</h5><p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/vs2019git%E4%BD%8D%E7%BD%AE.png" alt="VS2019的Git位置"></p>
<h5 id="Git-更改界面"><a href="#Git-更改界面" class="headerlink" title="Git 更改界面"></a>Git 更改界面</h5><p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Git%E6%9B%B4%E6%94%B9%E7%95%8C%E9%9D%A22.png" alt="Git更改界面2"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Git%E6%9B%B4%E6%94%B9%E7%95%8C%E9%9D%A2.png" alt="Git更改界面"></p>
<ul>
<li>提取：将远程库的代码更新到本地，但是没有合并</li>
<li>拉取：将远程库代码更新到本地，并合并</li>
<li>推送：将本地提交的代码推送到远程库，提交前记得拉取代码</li>
<li>同步：拉取+推送</li>
</ul>
<h5 id="Git-存储库"><a href="#Git-存储库" class="headerlink" title="Git 存储库"></a>Git 存储库</h5><p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Git%E5%AD%98%E5%82%A8%E5%BA%93.png" alt="Git存储库"></p>
<h3 id="在-VS2019-进行-Git-操作"><a href="#在-VS2019-进行-Git-操作" class="headerlink" title="在 VS2019 进行 Git 操作"></a>在 VS2019 进行 Git 操作</h3><h4 id="Git-常规操作"><a href="#Git-常规操作" class="headerlink" title="Git 常规操作"></a>Git 常规操作</h4><p>在使用 VS2019 操作 git 项目前，普及一下 git 常规操作。<br>假设你手上有一个项目，项目有两个分支，master（开发分支）和 release 分支（发布项目），平时开发使用开发分支的代码，等开发好了就将 master 分支合并到 release 分支去，这个过程存在以下操作：</p>
<ol>
<li>从远程库<strong>克隆</strong>代码到本地，分支默认 master</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%85%8B%E9%9A%86.png" alt="克隆"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF.png" alt="切换分支"></p>
<ol start="2">
<li>在 master 上修改代码，并进行<strong>提交</strong>操作，可能有多次提交，所以需要备注每次提交信息</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%85%A8%E9%83%A8%E6%8F%90%E4%BA%A4.png" alt="全部提交"></p>
<ol start="3">
<li>这里存在一种情况，比如我修改文件 1 和文件 2，我只想提交文件 1 的修改，这时候只要对文件 1 进行<strong>暂存</strong>操作，这样提交的就是文件 1 的操作，文件 2 未提交</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%9A%82%E5%AD%98%E6%8F%90%E4%BA%A4.png" alt="暂存提交"></p>
<ol start="4">
<li>项目开发过程中需要查看远程库更新了什么操作，使用<strong>提取</strong>，这个操作只能查看远程改了什么，本地代码没改变，需要在执行<strong>合并</strong>操作，本地代码才会改变</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8F%90%E5%8F%96.png" alt="提取"></p>
<ol start="5">
<li>更新代码还可以使用<strong>拉取</strong>操作，<strong>拉取=提取+合并</strong>，相比提取省去合并这一步骤，所以<strong>推荐使用拉取</strong></li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8B%89%E5%8F%96.png" alt="拉取"></p>
<ol start="6">
<li>本地修改提交和远程拉取的代码可能会存在<strong>冲突</strong>，这个时候就需<strong>解决冲突</strong>，不然影响后续操作</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%86%B2%E7%AA%81.png" alt="冲突"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%86%B2%E7%AA%812.png" alt="冲突2"></p>
<ol start="7">
<li>当你修改完，本地可能存在多个提交，按顺序可能存在提交 1、2、3，不过这时候的提交代码是<strong>针对本地代码，远程还没更新</strong>，需要执行<strong>推送</strong>操作，远程库才会更新，可以在存储库或更改处执行推送操作</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8E%A8%E9%80%81.png" alt="推送"></p>
<p>PS <strong>推送之前</strong>如果存在很多提交，有时候提交备注过多，显得很乱，这时候可以使用<strong>squash 提交</strong>操作，将多个提交合并成 1 个提交</p>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Squash%E6%8F%90%E4%BA%A4.png" alt="Squash提交"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Squash%E6%8F%90%E4%BA%A42.png" alt="Squash提交2"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/Squash%E6%8F%90%E4%BA%A43.png" alt="Squash提交2"></p>
<ol start="8">
<li>以上操作都是针对 master 分支上的，release 分支操作需要将 master 分支切换到 release 分支</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF1.png" alt="分支切换1"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%87%E6%8D%A2%E5%88%86%E6%94%AF2.png" alt="分支切换2"></p>
<ol start="9">
<li>release 需要更新 master 上的修改，需要进行<strong>合并</strong>操作，该操作一定要将分支切换到 release 上进行，这样就会把 master 上的全部提交合并到 release 上，合并后记得推送到远程库<br>ps：注意合并操作会把当前提交的的节点连同之前的提交一起合并过去，比如你有提交 1、2、3，你合并了提交 2，会把提交 1、和提交 2 合并过去。</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%90%88%E5%B9%B6.png" alt="合并"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%90%88%E5%B9%B62.png" alt="合并2"></p>
<ol start="10">
<li>项目中往往存在一种情况，比如某个 bug 线上非常急于更新，只想把提交 2 的更新到 release 上进行发布更新，这个时候就需要执行<strong>挑拣</strong>操作，这样只会把提交 2 的更新合并到 release，提交 1 不合并。挑拣可能存在冲突，需要解决冲突，才能推送到远程</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8C%91%E6%8B%A3.png" alt="挑拣"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8C%91%E6%8B%A32.png" alt="挑拣2"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8C%91%E6%8B%A33.png" alt="挑拣3"></p>
<h4 id="分支开发"><a href="#分支开发" class="headerlink" title="分支开发"></a>分支开发</h4><p>开发项目可能存在同时修改多个 bug 情况，这种情况如果在同一个分支开发，不利于代码维护，这个时候可以使用分支进行开发。</p>
<ol>
<li>本地<strong>创建分支</strong>bug 分支，有多少 bug 就创建多少个本地分支，这样开发互不干扰，创建的本地分支不推送到远程库，在分支上进行 bug 修改</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%96%B0%E5%BB%BA%E5%88%86%E6%94%AF.png" alt="新建分支"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%96%B0%E5%BB%BA%E5%88%86%E6%94%AF2.png" alt="新建分支2"></p>
<ol start="2">
<li>切换分支到 master 分支，将分支 bug <strong>挑拣</strong>到 master 上，并<strong>删除分支</strong>bug</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF%E4%BB%A3%E7%A0%81.png" alt="合并分支代码"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%A0%E9%99%A4%E5%88%86%E6%94%AF.png" alt="删除分支"></p>
<ol start="3">
<li>推送代码到远程库</li>
</ol>
<p><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E6%8E%A8%E9%80%81%E5%88%86%E6%94%AF%E4%BF%AE%E6%94%B9.png" alt="推送分支修改"><br><img src="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/%E5%88%86%E6%94%AF%E6%8E%A8%E9%80%812.png" alt="分支推送2"></p>
<p>PS：分支开发由于代码区分开来的，所以时间久了，代码容易与 master 上的冲突，所以需要时不时将 master 合并过来，防止代码冲突</p>

            <div class="post-copyright">
    <div class="content">
        <p>最后更新： 2021年07月16日 11:38</p>
        <p>原始链接： <a class="post-url" href="/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/" title="Visual Studio 2019 使用 Git">http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/</a></p>
        <footer>
            <a href="http://jiangkunyun.gitee.io">
                <img src="/images/mylogo.png" alt="jiangkunyun">
                jiangkunyun
            </a>
        </footer>
    </div>
</div>

      
        
            
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;">赏</a>
</div>

<div id="reward" class="post-modal reward-lay">
    <a class="close" href="javascript:;" id="reward-close">×</a>
    <span class="reward-title">
        <i class="icon icon-quote-left"></i>
        请我吃糖~
        <i class="icon icon-quote-right"></i>
    </span>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/images/wechat.jpg" alt="打赏二维码">
        </div>
        <div class="reward-select">
            
            <label class="reward-select-item checked" data-id="wechat" data-wechat="/images/wechat.jpg">
                <img class="reward-select-item-wechat" src="/images/wechat.png" alt="微信">
            </label>
            
            
            <label class="reward-select-item" data-id="alipay" data-alipay="/images/alipay.jpg">
                <img class="reward-select-item-alipay" src="/images/alipay.png" alt="支付宝">
            </label>
            
        </div>
    </div>
</div>


        
    </div>
    <footer class="article-footer">
        
        
<div class="post-share">
    <a href="javascript:;" id="share-sub" class="post-share-fab">
        <i class="fa fa-share-alt"></i>
    </a>
    <div class="post-share-list" id="share-list">
        <ul class="share-icons">
          <li>
            <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/&title=《Visual Studio 2019 使用 Git》 — JiangKunYun's Blog&pic=http://jiangkunyun.gitee.ioimages/mylogo.png" data-title="微博">
              <i class="fa fa-weibo"></i>
            </a>
          </li>
          <li>
            <a class="weixin share-sns" id="wxFab" href="javascript:;" data-title="微信">
              <i class="fa fa-weixin"></i>
            </a>
          </li>
          <li>
            <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/&title=《Visual Studio 2019 使用 Git》 — JiangKunYun's Blog&source=最近项目源代码管理工具从 SVN 移到 Git，操作上的不同，容易导致项目代码管理混乱。这里整理一份在 VS2019 里使用 git 的操作。" data-title="QQ">
              <i class="fa fa-qq"></i>
            </a>
          </li>
          <li>
            <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/" data-title="Facebook">
              <i class="fa fa-facebook"></i>
            </a>
          </li>
          <li>
            <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《Visual Studio 2019 使用 Git》 — JiangKunYun's Blog&url=http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/&via=http://jiangkunyun.gitee.io" data-title="Twitter">
              <i class="fa fa-twitter"></i>
            </a>
          </li>
          <li>
            <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/" data-title="Google+">
              <i class="fa fa-google-plus"></i>
            </a>
          </li>
        </ul>
     </div>
</div>
<div class="post-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;" id="wxShare-close">×</a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=http://jiangkunyun.gitee.io/git/VS2019/Visual-Studio-2019-%E4%BD%BF%E7%94%A8-Git/" alt="微信分享二维码">
</div>

<div class="mask"></div>

        
        <ul class="article-footer-menu">
            
            
  <li class="article-footer-tags">
    <i class="fa fa-tags"></i>
      
    <a href="/tags/git/" class="color4">git</a>
      
    <a href="/tags/VS2019/" class="color2">VS2019</a>
      
  </li>

        </ul>
        
    </footer>
  </div>
</article>


    <aside class="post-toc-pos post-toc-top" id="post-toc">
        <nav class="post-toc-wrap">
            <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#VS2019-Git-%E8%AE%BE%E7%BD%AE"><span class="post-toc-text">VS2019 Git 设置</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#%E6%BA%90%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7"><span class="post-toc-text">源代码管理工具</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#Git-%E6%93%8D%E4%BD%9C%E8%A7%86%E5%9B%BE"><span class="post-toc-text">Git 操作视图</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#%E5%9B%A2%E9%98%9F%E8%B5%84%E6%BA%90%E7%AE%A1%E7%90%86%E5%99%A8"><span class="post-toc-text">团队资源管理器</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#Git-%E6%9B%B4%E6%94%B9%E7%95%8C%E9%9D%A2"><span class="post-toc-text">Git 更改界面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#Git-%E5%AD%98%E5%82%A8%E5%BA%93"><span class="post-toc-text">Git 存储库</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#%E5%9C%A8-VS2019-%E8%BF%9B%E8%A1%8C-Git-%E6%93%8D%E4%BD%9C"><span class="post-toc-text">在 VS2019 进行 Git 操作</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#Git-%E5%B8%B8%E8%A7%84%E6%93%8D%E4%BD%9C"><span class="post-toc-text">Git 常规操作</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#%E5%88%86%E6%94%AF%E5%BC%80%E5%8F%91"><span class="post-toc-text">分支开发</span></a></li></ol></li></ol>
        </nav>
    </aside>
    

<nav id="article-nav">
  
  
    <a href="/%E6%A8%A1%E7%89%88%E5%BC%95%E6%93%8E/T4/T4%E6%A8%A1%E7%89%88%E7%94%9F%E6%88%90EF%E5%AE%9E%E4%BD%93/" id="article-nav-older" class="article-nav-link-wrap">
      <span class="article-nav-title">T4模版生成EF实体</span>
      <i class="fa fa-hand-o-right" aria-hidden="true"></i>
    </a>
  
</nav>



    
        <div id="SOHUCS" sid="Visual-Studio-2019-使用-Git" ></div>
<script type="text/javascript">
    (function(){
        var appid = 'cyvoqiokX';
        var conf = '54b1085fb6291057e24803fe79916138';
        var width = window.innerWidth || document.documentElement.clientWidth;
        if (width < 960) {
            window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); } })(); </script>
    
</section>
        
      </div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info" class="inner">
      
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


      <p>
        Powered by  <a href="http://hexo.io/" target="_blank">Hexo</a>
        Theme <a href="//github.com/wongminho/hexo-theme-miho" target="_blank">MiHo</a>
      &copy; 2021 jiangkunyun<br>
      </p>
    </div>
  </div>
</footer>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script>
  var mihoConfig = {
      root: "http://jiangkunyun.gitee.io",
      animate: true,
      isHome: false,
      share: true,
      reward: 1
  }
</script>
<div class="sidebar">
    <div id="sidebar-search" title="Search">
        <i class="fa fa-search"></i>
    </div>
    <div id="sidebar-category" title="Categories">
        <i class="fa fa-book"></i>
    </div>
    <div id="sidebar-tag" title="Tags">
        <i class="fa fa-tags"></i>
    </div>
    <div id="sidebar-top">
        <span class="sidebar-top-icon"><i class="fa fa-angle-up"></i></span>
    </div>
</div>
<div class="sidebar-menu-box" id="sidebar-menu-box">
    <div class="sidebar-menu-box-container">
        <div id="sidebar-menu-box-categories">
            <a class="category-link" href="/categories/git/">git</a><a class="category-link" href="/categories/git/VS2019/">VS2019</a><a class="category-link" href="/categories/%E6%A8%A1%E7%89%88%E5%BC%95%E6%93%8E/">模版引擎</a><a class="category-link" href="/categories/%E6%A8%A1%E7%89%88%E5%BC%95%E6%93%8E/T4/">T4</a>
        </div>
        <div id="sidebar-menu-box-tags">
            <a href="/tags/EF/" style="font-size: 10px;">EF</a> <a href="/tags/T4/" style="font-size: 10px;">T4</a> <a href="/tags/VS2019/" style="font-size: 10px;">VS2019</a> <a href="/tags/git/" style="font-size: 10px;">git</a>
        </div>
    </div>
    <a href="javascript:;" class="sidebar-menu-box-close">&times;</a>
</div>
<div class="mobile-header-menu-nav" id="mobile-header-menu-nav">
    <div class="mobile-header-menu-container">
        <span class="title">Menus</span>
        <ul class="mobile-header-menu-navbar">
            
            <li>
                <a  href="/">
                    <i class="fa fa-home"></i><span>首页</span>
                </a>
            </li>
            
            <li>
                <a  href="/archives">
                    <i class="fa fa-archive"></i><span>归档</span>
                </a>
            </li>
            
            <li>
                <a  href="/about">
                    <i class="fa fa-user"></i><span>关于</span>
                </a>
            </li>
            
        </ul>
    </div>
    <div class="mobile-header-tag-container">
        <span class="title">Tags</span>
        <div id="mobile-header-container-tags">
            <a href="/tags/EF/" style="font-size: 10px;">EF</a> <a href="/tags/T4/" style="font-size: 10px;">T4</a> <a href="/tags/VS2019/" style="font-size: 10px;">VS2019</a> <a href="/tags/git/" style="font-size: 10px;">git</a>
        </div>
    </div>
</div>
<div class="search-wrap">
    <span class="search-close">&times;</span>
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
            <i class="icon icon-lg icon-chevron-left"></i>
        </a>
        <input class="search-field" placeholder="Search..." id="keywords">
        <a id="search-submit" href="javascript:;">
            <i class="fa fa-search"></i>
        </a>
    <div class="search-container" id="search-container">
        <ul class="search-result" id="search-result">
        </ul>
    </div>
</div>

<div id="search-tpl">
    <li class="search-result-item">
        <a href="{url}" class="search-item-li">
            <span class="search-item-li-title" title="{title}">{title}</span>
        </a>
    </li>
</div>

<script src="/js/search.js"></script>


<script src="/js/main.js"></script>



  <script src="//cdn.bootcss.com/particles.js/2.0.0/particles.min.js"></script>
  <div id="particles"></div>
  
<script src="/js/particles.js"></script>








  
<link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.5.0/animate.min.css">

  <script src="//cdn.bootcss.com/scrollReveal.js/3.0.5/scrollreveal.js"></script>
  
<script src="/js/animate.js"></script>



  
<script src="/js/pop-img.js"></script>

  <script>
     $(".article-entry p img").popImg();
  </script>

  </div>
</body>
</html>